<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="sysDefault" />
<script type="text/javascript">
	$(document).ready(
			function() {
				$("#name").focus();
				$("#evaluateForm")
						.validate(
								{
									submitHandler : function(form) {
										Oosp_Loading('正在提交，请稍等...');
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			});
</script>
<style>
.o-vel-padding {
	padding-top: 5px;
	padding-left: 5px;
	padding-bottom: 20px;
}

.c-vel-padding {
	padding: 5px 5px;
}
</style>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<form:form id="evaluateForm" modelAttribute="sysEvaluate"
					action="${contextPath}/sys/evaluate/save" method="post"
					class="form-horizontal" role="form">
					<form:hidden path="modelId" />
					<form:hidden path="modelName" />
					<form:hidden path="createBy" />
					<form:hidden path="createTime" />
					<tags:message content="${message}" />
					<div class="row o-vel-padding">
						<div class="col-sm-12">
							<form:radiobutton id="score" checked="true" path="score"  class="required"
								 value="1" />
							<strong>非常满意</strong>
							<form:radiobutton id="score" path="score" class="required"
								value="2" />
							<strong>满意</strong>
							<form:radiobutton id="score" path="score" class="required"
								value="3" />
							<strong>不满意</strong>
						</div>
					</div>
					<div class="row">
						<div class="col-sm-12">
							<form:textarea id="content" path="content" htmlEscape="false"
								rows="4" class="form-control required"
								value="${sysEvaluate.modelId}" />
						</div>
					</div>
					<div class="row o-vel-padding">
						<div class="col-sm-6 ">
							<label class="checkbox-inline"> <input type="checkbox"
								id="notifyType" value="option1">待办
							</label> <label class="checkbox-inline"> <input type="checkbox"
								id="notifyType" value="option1">短信
							</label> <label class="checkbox-inline"> <input type="checkbox"
								id="notifyType" value="option1">邮件
							</label>
						</div>
						<div class="col-sm-6">
							<input class="btn btn-primary pull-right" type="submit"
								value="提交">
						</div>
					</div>
			</div>
			</form:form>
		</div>
		<div class="row">
			<div class="col-xs-12">
				<c:choose>
					<c:when test="${empty evaluateList}">
						<div class="well text-center">暂无评价</div>
					</c:when>
					<c:otherwise>
						<div class="panel panel-default">
							<tags:message content="${message}" />
							<tbody>
								<c:forEach items="${evaluateList}" var="sysEvaluate">
									<div class="panel-heading o-vel-padding">
										<div class="col-sm-6 text-left">

											用户<a href="#"><strong>${sysEvaluate.createBy}</strong></a>
											&nbsp;&nbsp;&nbsp;
											<fmt:formatDate value="${sysEvaluate.createTime}"
												pattern="yyyy-MM-dd" />

										</div>
										<div class="col-sm-6 text-right">
											该商品的评分为<strong>${sysEvaluate.score}</strong>
										</div>

									</div>
									<div class="panel-body">
										<div>
											<div class="text-left c-vel-padding">${sysEvaluate.content}</div>
										</div>
									</div>
								</c:forEach>
							</tbody>
						</div>
			</div>
			</c:otherwise>
			</c:choose>
		</div>
	</div>

	<script type="text/javascript">
		$(document)
				.ready(
						function() {
							parent.document.getElementById("evaluateFrame").height = document.body.scrollHeight + 30;

						});
	</script>



</body>
</html>